// Fill out your copyright notice in the Description page of Project Settings.


#include "DeformMeshActor.h"
#include "Components/DeformMeshComponent.h"

ADeformMeshActor::ADeformMeshActor()
{
	PrimaryActorTick.bCanEverTick = true;

	RootComponent = CreateDefaultSubobject<USceneComponent>("Root");

	DeformMeshComp = CreateDefaultSubobject<UDeformMeshComponent>("Deform Mesh");
}

void ADeformMeshActor::BeginPlay()
{
	Super::BeginPlay();
	
	//const auto Transform = 

	DeformMeshComp->CreateMeshSection(0, TestMesh, GetActorTransform());
}

void ADeformMeshActor::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

	DeformMeshComp->UpdateMeshSectionTransform(0, GetActorTransform());

	DeformMeshComp->FinishTransformsUpdate();
}

